﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Arcana.Contract.Tests.Method.Returns.Any.That.Is.Not
{
    [TestClass]
    public class InstanceOfAttributeTest
    {
        [Arcana.Contract.Method.Returns.Any.That.Is.Not.InstanceOf(typeof(string))]
        public static object[] Target(object[] x)
        {
            return x;
        }

        [TestMethod]
        [Owner("arcane_master_cp")]
        [WorkItem(55)]
        [ExpectedException(typeof(InvalidOperationException))]
        public void ShouldThrowException()
        {
            Target(new object[] { "d", "g" });
        }

        [TestMethod]
        [Owner("arcane_master_cp")]
        [WorkItem(55)]
        public void ShouldPass()
        {
            Target(new object[] { });
            Target(new object[] { "d", "f", "f", 4, "f" });
            Target(new object[] { "a", "a", null, "f" });
            Target(new object[] { null, null, null });
        }
    }
}
